﻿using HZU.ZP.Data.Impl;
using HZU.ZP.Data.Interfaces;
using HZU.ZP.Domain.IService;
using HZU.ZP.Domain.Model;
using HZU.ZP.Domain.ServiceImpl.Mappers;
using System;
using System.Collections.Generic;
using System.Text;

namespace HZU.ZP.Domain.ServiceImpl.PCSvc
{
    public class AdminService : IAdminService
    {
        private AdminMapper _mapper = new AdminMapper();
        private IAdminDao _sqlData;
        public AdminService(IAdminDao sqlData)
        {
            _sqlData = sqlData;
        }

        public Admin GetAdmin(string name)
        {
            return _mapper.MapToDomain(_sqlData.Get(name));
        }

        public Admin Login(string name, string password)
        {                       
            var admin = _sqlData.Get(name, password);
            return _mapper.MapToDomain(admin);
        }

    }
}
